using System;

namespace PingPong.Generic
{

	public class DataEventArgs<T> : EventArgs
	{
		#region Members

		/// <summary>
		/// The data.
		/// </summary>
		private Lazy<T> data;/// 

		#endregion

		#region Properties

		/// <summary>
		/// Gets the data.
		/// </summary>
		/// <value>The data.</value>
		public T Data
		{
			get
			{
				return this.data.Value;
			}
		}

		#endregion

		#region Constructors

		/// <summary>
		/// Initializes a new instance of the <see cref="PingPong.Generic.DataEventArgs`1"/> class.
		/// </summary>
		private DataEventArgs()
		{
			//No defaults.
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="PingPong.Generic.DataEventArgs`1"/> class.
		/// </summary>
		/// <param name="data">Data.</param>
		public DataEventArgs(T data)
		{
			this.data = new Lazy<T>(() => data);
		}

		#endregion
	}
}

